﻿using Cms.Core.Data.Mapping;
using Cms.Core.Data.Model;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;


namespace Cms.Core.Data.Configurations
{
    public class SysModuleConfigurations : EntityMappingConfiguration<SysModule>
    {
    

        public override void Map(EntityTypeBuilder<SysModule> builder)
        {

            base.MapCommon(builder);
            builder.Property(b => b.ParentId);
            builder.Property(b => b.Name).HasColumnType("nvarchar(50)").IsRequired(true);
            builder.Property(b => b.LinkUrl).HasColumnType("nchar(1000)").IsRequired(true);
            builder.Property(b => b.Area).HasColumnType("nvarchar(50)").IsRequired(false);
            builder.Property(b => b.Action).IsRequired(false);
            builder.Property(b => b.Code).HasColumnType("nvarchar(20)").IsRequired(false);
            builder.Property(b => b.OrderSort).HasDefaultValue(0);
            builder.Property(b => b.Description).HasColumnType("nvarchar(1000)").IsRequired(false);
            builder.Property(b => b.IsEnabled).HasDefaultValue(true).IsRequired(true);
            builder.Property(b => b.Parameter).HasColumnType("nvarchar(100)").IsRequired(false);
            builder.Property(b => b.Group).HasColumnType("nvarchar(100)").IsRequired(false);
            builder.ToTable("SysModule");
        }

     
    }
}
